using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Drawing;

    public static class cImageConverter
    {
        public static byte[] ImageToBytes(System.Drawing.Image value)
        {//Convert image to bytes
            MemoryStream ms = new MemoryStream();
            value.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
            return ms.ToArray();
        }
        public static Image BytesToImage(byte[] value)
        {//Convert bytes to image 
            MemoryStream ms = new MemoryStream(value);
            return  Image.FromStream(ms);
        }
 
    }
